package com.yoomiito.app.base;

import com.yoomiito.app.model.bean.BingPhoneBean;
import com.yoomiito.app.net.YmApi;

import cn.droidlover.xdroidmvp.net.XApi;
import io.reactivex.Flowable;

public class BaseAccountPresent<V extends BaseActivity> extends BaseActPresenter<V> {

    public BaseAccountPresent(AppConfig appConfig) {
        super(appConfig);
    }

    /**
     * 发送验证码
     * @param phone
     */
    public Flowable<BingPhoneBean> sendCode(String phone,String code){
        return YmApi.getYmService().sendCode(phone,code,"1")
                .compose(getV().bindToLifecycle())
                .compose(XApi.<BingPhoneBean>getApiTransformerData())
                .compose(XApi.<BingPhoneBean>getScheduler());
//                .subscribe(new ApiSubscriber<BingPhoneBean>() {
//                    @Override
//                    public void onSuccess(BingPhoneBean phoneBean) {
//
//                    }
//
//                    @Override
//                    public void onFail(ApiException error) {
//
//                    }
//                });
    }
}
